package com.eastfair.pay.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import com.eastfair.pay.enums.InvoiceApplyBusinessTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 发票申请
 * </p>
 *
 * @author gj
 * @since 2022-06-23
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("pay_invoice_apply")
@ApiModel(value = "InvoiceApply", description = "发票申请")
@AllArgsConstructor
public class InvoiceApply extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 合同id,结算单id
     */
    @ApiModelProperty(value = "合同id,结算单id")
    @TableField(value = "business_id")
    @Excel(name = "合同id,结算单id")
    private Long businessId;

    /**
     * 结算类型#{H:合同;J:结算单;}
     */
    @ApiModelProperty(value = "结算类型#{H:合同;J:结算单;}")
    @TableField(value = "business_type")
    @Excel(name = "结算类型#{H:合同;J:结算单;}", replace = {"合同_H", "结算单_J",  "_null"})
    private InvoiceApplyBusinessTypeEnum businessType;

    /**
     * 客户id
     */
    @ApiModelProperty(value = "客户id")
    @TableField(value = "cutomer_id")
    @Excel(name = "客户id")
    private Long cutomerId;

    /**
     * 客户名称
     */
    @ApiModelProperty(value = "客户名称")
    @Size(max = 255, message = "客户名称长度不能超过255")
    @TableField(value = "cutomer_name", condition = LIKE)
    @Excel(name = "客户名称")
    private String cutomerName;

    /**
     * 发票抬头
     */
    @ApiModelProperty(value = "发票抬头")
    @Size(max = 255, message = "发票抬头长度不能超过255")
    @TableField(value = "invoice_title", condition = LIKE)
    @Excel(name = "发票抬头")
    private String invoiceTitle;

    /**
     * 税号
     */
    @ApiModelProperty(value = "税号")
    @Size(max = 255, message = "税号长度不能超过255")
    @TableField(value = "invoice_duty_paragraph", condition = LIKE)
    @Excel(name = "税号")
    private String invoiceDutyParagraph;

    /**
     * 费用类型（数据字典）
     */
    @ApiModelProperty(value = "费用类型（数据字典）")
    @Size(max = 255, message = "费用类型（数据字典）长度不能超过255")
    @TableField(value = "cost_type", condition = LIKE)
    @Excel(name = "费用类型（数据字典）")
    private String costType;

    /**
     * 开票单位地址
     */
    @ApiModelProperty(value = "开票单位地址")
    @Size(max = 255, message = "开票单位地址长度不能超过255")
    @TableField(value = "company_address", condition = LIKE)
    @Excel(name = "开票单位地址")
    private String companyAddress;

    /**
     * 开票单位电话
     */
    @ApiModelProperty(value = "开票单位电话")
    @Size(max = 255, message = "开票单位电话长度不能超过255")
    @TableField(value = "company_tel", condition = LIKE)
    @Excel(name = "开票单位电话")
    private String companyTel;

    /**
     * 经手人id
     */
    @ApiModelProperty(value = "经手人id")
    @TableField(value = "applicant_id")
    @Excel(name = "经手人id")
    private Long applicantId;

    /**
     * 经手人名称
     */
    @ApiModelProperty(value = "经手人名称")
    @Size(max = 255, message = "经手人名称长度不能超过255")
    @TableField(value = "applicant_name", condition = LIKE)
    @Excel(name = "经手人名称")
    private String applicantName;

    /**
     * 展会id
     */
    @ApiModelProperty(value = "展会id")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会id")
    private Long exhibitionId;

    /**
     * 展会名称
     */
    @ApiModelProperty(value = "展会名称")
    @Size(max = 255, message = "展会名称长度不能超过255")
    @TableField(value = "exhibition_name", condition = LIKE)
    @Excel(name = "展会名称")
    private String exhibitionName;

    /**
     * 对方账号
     */
    @ApiModelProperty(value = "对方账号")
    @Size(max = 255, message = "对方账号长度不能超过255")
    @TableField(value = "bank_account_num", condition = LIKE)
    @Excel(name = "对方账号")
    private String bankAccountNum;

    /**
     * 对方开户行
     */
    @ApiModelProperty(value = "对方开户行")
    @Size(max = 255, message = "对方开户行长度不能超过255")
    @TableField(value = "bank_name", condition = LIKE)
    @Excel(name = "对方开户行")
    private String bankName;

    /**
     * 成功开票数量
     */
    @ApiModelProperty(value = "成功开票数量")
    @TableField(value = "success_num")
    @Excel(name = "成功开票数量")
    private Integer successNum;

    /**
     * 系统code
     */
    @ApiModelProperty(value = "系统code")
    @Size(max = 20, message = "系统code长度不能超过20")
    @TableField(value = "system_code", condition = LIKE)
    @Excel(name = "系统code")
    private String systemCode;

    /**
     * 开票金额
     */
    @ApiModelProperty(value = "开票金额")
    @TableField(value = "invoice_amount")
    @Excel(name = "开票金额")
    private BigDecimal invoiceAmount;

    /**
     * 申请人ID
     */
    @ApiModelProperty(value = "申请人ID")
    @TableField(value = "application_id")
    @Excel(name = "申请人ID")
    private Long applicationId;

    /**
     * 申请人姓名
     */
    @ApiModelProperty(value = "申请人姓名")
    @Size(max = 255, message = "申请人姓名长度不能超过255")
    @TableField(value = "application_name", condition = LIKE)
    @Excel(name = "申请人姓名")
    private String applicationName;

    /**
     * 收件人
     */
    @ApiModelProperty(value = "收件人")
    @Size(max = 255, message = "收件人长度不能超过255")
    @TableField(value = "addressee", condition = LIKE)
    @Excel(name = "收件人")
    private String addressee;

    /**
     * 收件人地址
     */
    @ApiModelProperty(value = "收件人地址")
    @Size(max = 255, message = "收件人地址长度不能超过255")
    @TableField(value = "to_address", condition = LIKE)
    @Excel(name = "收件人地址")
    private String toAddress;

    /**
     * 收件人手机号
     */
    @ApiModelProperty(value = "收件人手机号")
    @Size(max = 255, message = "收件人手机号长度不能超过255")
    @TableField(value = "mobile", condition = LIKE)
    @Excel(name = "收件人手机号")
    private String mobile;

    /**
     * 收件人邮箱
     */
    @ApiModelProperty(value = "收件人邮箱")
    @Size(max = 255, message = "收件人邮箱长度不能超过255")
    @TableField(value = "mailbox", condition = LIKE)
    @Excel(name = "收件人邮箱")
    private String mailbox;

    /**
     * 发票类型（数据字典)
     */
    @ApiModelProperty(value = "发票类型（数据字典)")
    @Size(max = 255, message = "发票类型（数据字典)长度不能超过255")
    @TableField(value = "invoice_type", condition = LIKE)
    @Excel(name = "发票类型（数据字典)")
    private String invoiceType;

    /**
     * 开票状态 数据字典
     */
    @ApiModelProperty(value = "开票状态 数据字典")
    @TableField(value = "invoice_state")
    @Excel(name = "开票状态 数据字典")
    private String invoiceState;

    /**
     * 回调服务名称
     */
    @ApiModelProperty(value = "回调服务名称")
    @TableField(value = "callback_service_name")
    @Excel(name = "回调服务名称")
    private String callbackServiceName;

    /**
     *回调接口地址
     */
    @ApiModelProperty(value = "回调接口地址")
    @TableField(value = "callbakc_api")
    @Excel(name = "回调接口地址")
    private String callbakcApi;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @TableField(value = "remark")
    @Excel(name = "备注")
    private String remark;

    @Builder
    public InvoiceApply(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime,
                        Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId,
                        Long businessId, InvoiceApplyBusinessTypeEnum businessType, Long cutomerId, String cutomerName, String invoiceTitle, String invoiceDutyParagraph,
                        String costType, String companyAddress, String companyTel, Long applicantId, String applicantName, Long exhibitionId,
                        String exhibitionName, String bankAccountNum, String bankName, Integer successNum, String systemCode, BigDecimal invoiceAmount,
                        Long applicationId, String applicationName, String addressee, String toAddress, String mobile, String mailbox, String invoiceType) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.businessId = businessId;
        this.businessType = businessType;
        this.cutomerId = cutomerId;
        this.cutomerName = cutomerName;
        this.invoiceTitle = invoiceTitle;
        this.invoiceDutyParagraph = invoiceDutyParagraph;
        this.costType = costType;
        this.companyAddress = companyAddress;
        this.companyTel = companyTel;
        this.applicantId = applicantId;
        this.applicantName = applicantName;
        this.exhibitionId = exhibitionId;
        this.exhibitionName = exhibitionName;
        this.bankAccountNum = bankAccountNum;
        this.bankName = bankName;
        this.successNum = successNum;
        this.systemCode = systemCode;
        this.invoiceAmount = invoiceAmount;
        this.applicationId = applicationId;
        this.applicationName = applicationName;
        this.addressee = addressee;
        this.toAddress = toAddress;
        this.mobile = mobile;
        this.mailbox = mailbox;
        this.invoiceType = invoiceType;
    }

}
